package main

import "fmt"

type Student struct {
	name string
	age int
}

func main() {
	list := make([]interface{}, 3)
	list[0] = 1
	list[1] = 2
	list[2] = &Student{"mike", 11}
	for i,item := range list {
		switch v := item.(type) {
		case int:
			fmt.Printf("list[%d] is int, value is %d\n", i, v)
		case *Student:
			fmt.Printf("list[%d] is *Student, value is %+v\n", i, v)
		}
	}
}